{% extends "index.html" %}

{% load item_tags %}

{% block inline_navi %}
    {% item_add_inline document %}
    Zu Dokument hochladen
{% endblock %}

{% block box_title %}
	Upload
{% endblock %}
{% block box_content %}
	<p>
	    Hier kannst du eine neue Datei für <b>{{ document.module_part.module.name }} {{ document.module_term.semester }} ({{ document.module_part.name }})</b> hochladen.
	    {% item_description %}
	</p>
	
	<div id="detail_table">
	    <h3>Uploadformular</h3>
	    <form action="{% url upload.views.add_upload document.id %}" enctype="multipart/form-data" method="post">
	        {% csrf_token %}
	        {{ item_form.non_field_errors }}
	        {{ upload_form.non_field_errors }}
	        <table>
	            <!-- Upload File -->
	            <tr>
	                {% if upload_form.upload.errors %}
	                <th class="form_error"><label for="id_upload">Datei*{{ upload_form.upload.errors }}</label></th>
	                {% else %}
	                <th><label for="id_upload">Datei*:</label></th>
	                {% endif %}
	                <td>{{ upload_form.upload }}</td>
	            </tr>
				{% item_fields item_form document.module_part document.module_term %}
	            <tr>
	                <td colspan="2" align="center" style="padding-top: 10px;">
	                    <input type="submit" value="Upload" />
	                </td>
	            </tr>
	        </table>
	    </form>
	</div>
{% endblock %}